﻿using System;
using System.Collections.Generic;
using System.Diagnostics.Contracts;
using System.Linq;
using System.Text;

namespace Cloak.Mvp.Autofac
{
	/// <summary>
	/// The point at which a keyed presenter is bound to a particular view instance
	/// </summary>
	public class KeyedPresenterSite : PresenterSite
	{
		/// <summary>
		/// Initializes a site with the specified presenter type, key and view
		/// </summary>
		/// <param name="presenterType">The type of presenter which handles the view</param>
		/// <param name="key">The key of the presenter which handles the view</param>
		/// <param name="view">The view instance which is handled by the presenter</param>
		public KeyedPresenterSite(Type type, object key, object view) : base(type, view)
		{
			Contract.Requires(key != null);

			Key = key;
		}

		/// <summary>
		/// Gets the key of the presenter which handles the view
		/// </summary>
		public object Key { get; private set; }
	}
}